from redis import StrictRedis
class Config():
    DEBUG = None
    SECRET_KEY = '0MxoXOHWOhbY8Hq5msPqmYYJc5DdwCNRCImfRuRvMy3o62z7kKJMMQ=='
    SQLALCHEMY_DATABASE_URI = 'mysql://root:123456@localhost/News_Information'
    SQLALCHEMY_TRACK_MODIFICATIONS = False

    REDIS_HOST = 'localhost'
    REDIS_PORT = 6379
    # 配合状态保持存储的session信息
    SESSION_TYPE = 'redis'
    # session签名
    SESSION_USE_SIGNER = True
    # resid实例
    SESSION_REDIS = StrictRedis(host=REDIS_HOST, port=REDIS_PORT, db=1)
    PERMANENT_SESSION_LIFETIME = 86400
class production_model(Config):
    DEBUG = False

class development_model(Config):
    DEBUG = True

config = {
    'production':production_model,
    'development': development_model
}
